//
//  MKUICollectionViewSupplementaryView.m
//  MKUI
//
//  Created by sushangjin on 15/9/15.
//  Copyright © 2020 sushangjin. All rights reserved.
//

#import "MKUICollectionViewSupplementaryView.h"
#import "UIView+MKUI.h"

@implementation MKUICollectionViewSupplementaryView
- (id)initWithFrame:(CGRect)frame{
	if (self=[super initWithFrame:frame]) {
		self.contentView = [[UIView alloc] init];
		self.contentView.accessibilityLabel = @"contentView";
		[self addSubview:self.contentView];
	}
	return self;
}
- (void)layoutSubviews{
	[super layoutSubviews];
	CGRect bounds = self.bounds;
	//适配iphoneX
    if(@available(iOS 11.0,*)){
        bounds = self.safeAreaLayoutGuide.layoutFrame;
    }
	self.contentView.frame = bounds;
}
#pragma mark - protocol:MKUICollectionViewSupplementaryElementProtocol
- (void)setCollectionSectionModel:(MKUICollectionViewSectionModel *)sectionModel forKind:(NSString *)kind{
	self.sectionModel = sectionModel;
	self.kind = kind;
}
+ (CGSize)referenceSizeWithCollectionView:(UICollectionView *)collectionView collectionSectionModel:(MKUICollectionViewSectionModel *)sectionModel forKind:(NSString *)kind{
	return CGSizeZero;
}
@end
